Skip to content

Conversation

@ashleysommer
Copy link

Description

Save lock-token from receive_deferred_messages AMQP payload, so it can be used as the message's lock_token property. This allows the deferred message to be correctly renewed or settled (abandoned, completed, deferred again).

Fixes #42454

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

This is for initial review. I have not included anything in Changelog.
There are no tests at all in the codebase for deferred messages or anything to do with parsing deferred messages, so I don't know where to add a regression test for this.

…an be used as the message's lock_token property. This allows the deferred message to be correctly renewed or settled (abandoned, completed, deferred again).
Copilot AI review requested due to automatic review settings August 12, 2025 02:45
@github-actions github-actions bot added Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Aug 12, 2025
@github-actions
Copy link

Thank you for your contribution @ashleysommer! We will review the pull request and get back to you soon.

This comment was marked as outdated.

@ashleysommer
Copy link
Author

@microsoft-github-policy-service agree

…ived lock token in the constructor

Co-authored-by: Copilot <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug where deferred Service Bus messages were not properly retaining their lock tokens from the AMQP payload, preventing proper message renewal and settlement operations. The fix ensures that when receiving deferred messages, the lock token from the AMQP response is correctly extracted and assigned to the ServiceBusReceivedMessage object.

Key changes:

  • Extract lock token from AMQP payload for deferred messages in both transport implementations
  • Store the received lock token in the message object during initialization
  • Update the lock_token property to prioritize the received lock token over the delivery tag

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
_uamqp_transport.py Extract lock token from deferred message AMQP payload and pass to message constructor
_pyamqp_transport.py Extract lock token from deferred message AMQP payload and pass to message constructor
message.py Store received lock token and prioritize it in the lock_token property

@github-actions
Copy link

Hi @ashleysommer. Thank you for your interest in helping to improve the Azure SDK experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days.

@github-actions github-actions bot added the no-recent-activity There has been no recent activity on this issue. label Oct 17, 2025
@ashleysommer
Copy link
Author

Yes, this PR is still needed, still waiting for a human to review it.

@github-actions github-actions bot removed the no-recent-activity There has been no recent activity on this issue. label Oct 17, 2025
@ashleysommer
Copy link
Author

This still needs human review, and needs someone to complete the final parts of adding regression tests and writing changelog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Bus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ServiceBus] Message received from receive_deferred_messages does not have a lock token.

1 participant